﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Wimm.Common.Entities.Utils
{
    public class TimePeriod
    {
        public DateTimeOffset Start { get; protected set; }
        public DateTimeOffset End { get; protected set; }
        public String Name { get; protected set; }

        public static IEnumerable<TimePeriod> GetConfiguration(string lang)
        {
            var todayDate = new DateTimeOffset(DateTimeOffset.Now.Year, DateTimeOffset.Now.Month, DateTimeOffset.Now.Day, 0, 0, 0, DateTimeOffset.Now.Offset);
            TimePeriod p1 = new TimePeriod() { Name = "FilterToday".GetStringFromResource(lang), Start = todayDate, End = todayDate };
            TimePeriod p2 = new TimePeriod() { Name = "FilterYesterday".GetStringFromResource(lang), Start = todayDate.AddDays(-1), End = todayDate.AddDays(-1) };
            TimePeriod p3 = new TimePeriod() { Name = "FilterThisweek".GetStringFromResource(lang), Start = todayDate.AddDays(-7), End = todayDate };
            TimePeriod p4 = new TimePeriod() { Name = "FilterCustom".GetStringFromResource(lang) };

            return new List<TimePeriod>() { p4, p1, p2, p3 };

        }
    }
}
